package com.jic.product.service;

import com.github.pagehelper.PageInfo;
import com.jic.common.base.vo.Page;
import com.jic.common.base.vo.PageResult;
import com.jic.common.base.vo.RestResult;
import com.jic.product.entity.Category;
import com.jic.product.entity.ProductBrand;
import com.jic.product.entity.vo.request.CategoryPage;
import com.jic.product.manage.request.CategoryRequest;
import com.jic.product.manage.request.FirstCategoryEditRequest;
import com.jic.product.manage.response.CategoryResponse;
import com.jic.product.manage.response.CategorySecondRest;
import com.jic.product.manage.response.CategorySecondSonRest;

import java.util.List;

/**
* 类目节点
* @author :
* @email :
* @since : 2020-01-10 07:03:01
* @version : v1.0.0
*/
public interface CategoryService {
    List<CategoryResponse>selectCategory (Category category);

    RestResult<PageResult<List<CategoryResponse>>> selectPageCategory(CategoryPage request);

    RestResult insert(FirstCategoryEditRequest firstCategoryEditRequest);

    /**
     * 类目详情修改
     * @param firstCategoryEditRequest
     * @return
     */
    RestResult categoryUpdate(FirstCategoryEditRequest firstCategoryEditRequest);

    /**
     * 子类目新增
     * @param firstCategoryEditRequest
     * @return
     */
    RestResult categoryAdd(FirstCategoryEditRequest firstCategoryEditRequest);

    RestResult delete(Long id);


    long update(Category category);

    Category queryByPrimaryKey(Long id);

    List<CategoryResponse> queryBehindCategory(CategoryRequest categoryRequest);//查询后台类目

    List<CategoryResponse> queryBeforeCategory(CategoryRequest categoryRequest);//查询前台类目

    List<CategorySecondRest> queryBeforeSecondCategory(CategoryRequest categoryRequest);//查询当前生效的所有二级类目

    List<CategorySecondSonRest> queryBeforeSecondSonCategory(CategoryRequest categoryRequest);//查询当前二级类目的子类目

    PageResult<Category> queryPage(Category category, Page pageQuery);

    List<Category> queryRestCategory();//查询前台一级类目

    List<Category> query(Category category);

    List<CategoryResponse> queryAfterSecondSonCategory(CategoryRequest categoryRequest);//查询当前二级类目的子类目


    RestResult<List<CategoryResponse>> queryRestCategoryForIndex();//查询首页类目

    List<Long> queryAfterCategoryByRestCategory(Long restCategoryId);//根据前台类目id返回聚合的后台类目

    List<Long> queryLastCategoryById(Long restCategoryId);//根据d类目的所有叶子节点类目

    List<CategorySecondSonRest> queryBeforeSecondSonCategoryForPc(CategoryRequest categoryRequest);//查询当前二级类目的子类目PC


    List<CategorySecondRest> queryLastCategory(Long restCategoryId);//查询当前类目的所有叶子节点类目

    List<CategoryResponse> queryMerchantBehindCategory(CategoryRequest categoryRequest);//查询商家类目


    PageResult<Category> listRestPage(Category category, Page pageQuery);

    RestResult updateIncrement(FirstCategoryEditRequest firstCategoryEditRequest);

}
